import { uJob, d_sort, cline, obj_str } from 'sui';

const reload = (hDone, mod, cur, setMain) => {
    uJob(hDone, "pick/load",
        {
            line: cline(),
            tech: obj_str(cur, "sn"),
            tp: mod,
        },
        r => {
            d_sort(r, "sn");
            r.forEach((d, i) => d["index"] = i + 1);

            setMain(r);
        },
        e => setMain(null));
};

export {reload};
